from google.appengine.ext import db, webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from user_profile import model

import cgi
import os

class Read(webapp.RequestHandler):
  def get(self):
    key_name = self.request.get('key')
    user_profile = db.get(db.Key(key_name))
    self.response.headers['Content-Type'] = 'text/xml'
    self.response.out.write(user_profile.to_xml())

application = webapp.WSGIApplication([('/user_profile/read', Read)], debug=True)


def main():
  run_wsgi_app(application)

if __name__ == '__main__':
  main()
